<%--
    Document   : index
    Created on : Mar 6, 2011, 9:48:04 AM
    Author     : Vinh_Dragon
--%>

<%@page import="com.myapp.entities.Survey"%>
<%@page import="java.util.ArrayList"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@page import="com.myapp.biz.SurveyBiz" %>
<html lang="en">
    <head>
        <title></title>
        <meta charset="utf-8">
        <link rel="stylesheet" href="css/reset.css" type="text/css" media="all">
        <link rel="stylesheet" href="css/grid.css" type="text/css" media="all">
        <link rel="stylesheet" href="css/style.css" type="text/css" media="all">
        <script type="text/javascript" src="js/jquery-1.4.2.min.js" ></script>
        <script type="text/javascript" src="js/cufon-yui.js"></script>
        <script type="text/javascript" src="js/Bell_Gothic_Std_500.font.js"></script>
        <script type="text/javascript" src="js/Bell_Gothic_Std_700.font.js"></script>
        <script type="text/javascript" src="js/cufon-replace.js"></script>
        <!--[if lt IE 7]>
  	<script type="text/javascript" src="http://info.template-help.com/files/ie6_warning/ie6_script_other.js"></script>
        <![endif]-->
        <!--[if lt IE 9]>
  	<script type="text/javascript" src="js/html5.js"></script>
        <![endif]-->
    </head>

    <body>
        <%
                    HttpSession sess = request.getSession(true);
                    if (sess.getAttribute("username") == null) {
                        response.sendRedirect("login.jsp");
                    }
        %>
        <!-- header -->
    <header>
        <div class="header-bg">
            <div class="container_24">
                <div class="logo">
                    <a href="index.html"><img src="images/logo.jpg" alt=""></a>
                </div>
                <nav>
                    <ul>
                        <li><a href="index.html" class="current">Home</a></li>                        
                        <li><a href="student.jsp">Do Survey</a></li>
                        <li><a href="#">FAQ</a></li>
                         <li><a href="login.jsp">Log Off</a></li>
                    </ul>
                </nav>
                <a href="#" class="rss">RSS Submit</a>
                <a href="#" class="main-banner"><img src="images/main-banner.jpg" alt=""></a>
            </div>
        </div>
    </header>
    <!-- content -->
    <html:form action="/studentExam">
    <section id="content">
        <div class="container_24">
            <div class="row">
                <div class="wrapper">
                    <div class="grid_16">
                        <div class="box">
                            <h2><span>Complete your servey</span></h2>
                            <table border="1">

                                <tr>
                                    <%
                                                SurveyBiz surBiz = new SurveyBiz();
                                                ArrayList<Survey> lst = new ArrayList<Survey>();
                                                lst = surBiz.getListSurvey(this.getServletContext().getRealPath("/"), "surveys.xml");
                                                for (int i = 0; i < lst.size(); i++) {
                                                    if (lst.get(i).getSurveyStatus().equalsIgnoreCase("show")) {

                                    %>
                                    <td><font color="blue" style="font-style:italic;font-weight:bold">
                                            Question:<%=lst.get(i).getContent()%></font>
                                            <html:hidden property="surveyId" value="<%=lst.get(i).getSurveyId()%>"></html:hidden>
                                    </td>
                                </tr>
                                <%for (int j= 0; j < lst.get(i).getAnsList().size(); j++) {                                    
                                %>
                                <tr>
                                    <td><html:multibox property="answers" value="<%=lst.get(i).getAnsList().get(j)%>"/><%=lst.get(i).getAnsList().get(j)%></td>
                                </tr>
                                <%}%>
                                <%}}%>
                                <tr>
                                <br>
                                <tr>
                                    <td>
                                        <hr>
                                    </td>
                                </tr>
                                <tr>
                                    <td>Please give extra comment:  </td>
                                </tr>
                                <tr>
                                    <td>
                                        <html:textarea property="comment"  rows="5" style="width:400px"></html:textarea>
                                    </td>
                                </tr>
                                <td align="center">
                                        <html:submit value="Submit"></html:submit>
                                    </td>
                                </tr>
                            </table>
                        </div>
                    </div>
                    <div class="grid_8">
                        <a href="#"><img src="images/banner.jpg" alt=""></a>
                    </div>
                </div>
            </div>

        </div>
    </section>
</html:form>
    <!-- footer -->
    <footer>
        <div class="container_24">
            <div class="wrapper">
                <div class="copy">ABC Company &copy; 2010 &nbsp; | &nbsp; <a href="http://www.websitetemplates.org">Website Templates</a> designed by <a title="Free Templates Online" href="http://www.freetemplatesonline.com">FTO</a> </div>
                <nav>
                    <ul>
                        <li><a href="index.html" class="current">Home page</a></li>
                        <li><a href="index-1.html">About Us</a></li>
                        <li><a href="index-2.html">Solutions</a></li>
                        <li><a href="index-3.html">Clients</a></li>
                        <li><a href="index-4.html">FAQ</a></li>
                        <li><a href="index-5.html">Contacts</a></li>
                    </ul>
                </nav>
            </div>
        </div>
    </footer>
    <script type="text/javascript"> Cufon.now(); </script>
</body>

</html>

